package com.luping.xiao.xiao.utils.Thread;

import org.apache.commons.lang3.concurrent.BasicThreadFactory;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
 * 线程生产者
 */
public class TestThreadPool {
    private static ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(100,
            new BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d").daemon(true).build());

    public static void productMethod(String name, Integer age) {
        executorService.execute(new ThreadRunProducer(name, age));
    }
}
